﻿using System.Linq;
using System.Web;
using Nydus.Model.Entities;
using Nydus.Model.Repositories;
using Nydus.WebForms.Frontend.Views;
using Nydus.WebForms.FrontendModel;

namespace Nydus.WebForms.Frontend.Presenters
{
    public class CustomerDetailsPresenter : BasePresenter<Customer, ICustomerDetailsView>
    {
        public CustomerDetailsPresenter(ICustomerDetailsView view, HttpContextBase httpContext)
            : base(view, httpContext)
        {
            
        }

        protected override void OnLoad()
        {
            var uow = new UnitOfWork();
            var customerRepository = new CustomerRepository(uow);

            this.View.Model = customerRepository.All.FirstOrDefault();

            base.OnLoad();
        }
    }
}